<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>表单提交测试</title>
<link href="https://cdn.bootcss.com/bootstrap/4.0.0/css/bootstrap.css"
	rel="stylesheet">
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/jquery-cookie/1.4.1/jquery.cookie.js"></script>
</head>
<body>
	<form class="form-horizontal" role="form">
		<div class="form-group">
			<label for="firstname" class="col-sm-2 control-label">姓名</label>
			<div class="col-sm-10">
				<input type="text" onblur="getToken()" class="form-control"
					id="firstname" placeholder="请输入姓名">
			</div>
		</div>

		<div class="form-group">
			<label for="firstname" class="col-sm-2 control-label">年龄</label>
			<div class="col-sm-10">
				<input type="text" class="form-control" id="firstname"
					placeholder="请输入年龄">
			</div>
		</div>

		<div class="form-group">
			<div class="col-sm-offset-2 col-sm-10">
				<button type="button" onclick="create()" class="btn btn-primary">保存</button>
			</div>
		</div>
	</form>


	<script type="text/javascript">
		function getToken() {
			$.get("/settingCookie", function(resp) {

			});

		}

		function create() {
			
			//var tokenName = cookies[0];
			$.get("/createOrder?token=" + $.cookie("myToken"), function(resp) {
				console.log(resp)

			});

		}
	</script>

</body>
</html>